package com.xinqi.common.core.enums;

import java.util.Objects;

/**
 * 公开个人信息-枚举
 */
public enum ShowInfoEnum {

    ALL(0, "所有人"),
    FRIEND(1, "好友可见"),
    OWN(2, "仅自己");

    //是否显示0否1是
    private Integer code;
    private String description;

    ShowInfoEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static boolean checkIn(Integer code) {
        if (Objects.equals(ShowInfoEnum.ALL.getCode(), code)
            || Objects.equals(ShowInfoEnum.FRIEND.getCode(), code)
            || Objects.equals(ShowInfoEnum.OWN.getCode(), code)) {
            return true;
        } else {
            return false;
        }
    }

}
